home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PBLIB1 / PROGS / PATCHFIL.DOC < prev    next >
Text File  |  1994-05-02  |  1KB  |  30 lines

  1. PATCHFIL - Program to make substitution type changes to text files
  2.  
  3. >PATCHFIL <textfile1> cmdfile=<cmdfile>
  4.  
  5. <cmdfile> contains one or more string substitutions like:
  6. [ain't]/[isn't]
  7. [cat]/[DOG]
  8. [quick brown fox]/[small blue squirrel]
  9.    one per line, square brackets around the strings
  10.  
  11. <textfile1> is renamed <textfile1>.bak (purging the bak file if it
  12. already exists.  The file is then copied line by line with the whole
  13. group of change strings being applied as needed.  -- Be careful of
  14. recursive changes like [cat]/[cats] which won't do what you want.
  15.  
  16. PATCHFIL.CFG (or the cmd line) can have some option controls:
  17. BOTH=YES/NO    {def YES} means match upper or lower case or mixed
  18. ALL=YES/NO     {def YES} means apply each change as many times as possible
  19.                           to each line.
  20.  
  21. ?SECTION NOTES
  22.  
  23. This program is NOT elegant or particularly fast, but it seems to work
  24. well as I migrate libraries with major name changes in them.  I use
  25. batch files to apply the changes to many files in sequence.  For safety,
  26. I work on a new directory, copying the original file then applying
  27. the changes and re-compiling to check.
  28.  
  29. Other than the recursive change difficulty, I have not encountered
  30. any problems.